/**
 * 
 */
package ru.tatintec.gwttest.client.view;

import org.moxieapps.gwt.highcharts.client.Chart;
import org.moxieapps.gwt.highcharts.client.Series;
import org.moxieapps.gwt.highcharts.client.plotOptions.ColumnPlotOptions;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * @author ruslan
 *
 */
public class EmployeeReportComposite extends Composite {

	private ListBox listBox = new ListBox();
	private Chart chart = new Chart();

	/**
	 * 
	 */
	public EmployeeReportComposite() {
		super();
		VerticalPanel vp = new VerticalPanel();
		initWidget(vp);

		setWidth("100%");
		vp.setWidth("100%");

		listBox.addItem("Group by birth year", "0");
		listBox.addItem("Group by employment date", "1");
		
		Label label = new Label("Shoose the report: ");
		VerticalPanel hp = new VerticalPanel();
		hp.add(label);
		hp.add(listBox);
		vp.add(hp);

        chart.setType(Series.Type.COLUMN)
	        .setColumnPlotOptions(new ColumnPlotOptions()  
	            .setPointPadding(0.2)  
	            .setBorderWidth(0)  
	        );  
        
		chart.getYAxis()  
	        .setAxisTitleText("Number of employees")  
	        .setMin(0);  

		chart.setChartTitleText("Employees chart");  

		vp.add(chart);
	}
	
	public ListBox getListBox() {
		return listBox;
	}

	public Chart getChart() {
		return chart;
	}

}
